package com.zhehekeji.opsys.api.webservice.server;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import org.apache.cxf.rs.security.cors.CrossOriginResourceSharing;

import com.zhehekeji.opsys.api.resp.AddZoneCollectResp;
import com.zhehekeji.opsys.api.resp.AddZonePlayRecordResp;
import com.zhehekeji.opsys.api.resp.GetZoneCollectListResp;
import com.zhehekeji.opsys.api.resp.GetZoneCollectResp;
import com.zhehekeji.opsys.api.resp.GetZonePlayRecordListResp;
import com.zhehekeji.opsys.api.resp.GetZonePlayRecordResp;
import com.zhehekeji.opsys.api.resp.RemoveZoneCollectResp;
import com.zhehekeji.opsys.api.resp.RemoveZonePlayRecordResp;

/**
 * @author chenweiliu chenwei.liu@163.com
 * @ClassName ZoneManager
 * @Description TODO
 * @date 2016-7-18   下午3:42:34
 */
@Path(value = "/")
@WebService
@CrossOriginResourceSharing(allowAllOrigins = true)
public interface ZoneManager {

    /*	@POST
        @Path(value="addCollect")
        @Consumes(value=MediaType.APPLICATION_JSON )
        @Produces(value=MediaType.APPLICATION_JSON )
        @WebMethod(action="doAddCollect",operationName="addCollect")
        AddZoneCollectResp addCollect(AddCollectReq addCollectReq);
    */
    @GET
    @Path(value = "addCollect")
    @Produces(value = MediaType.APPLICATION_JSON)
    @WebMethod(action = "doAddCollect", operationName = "addCollect")
    AddZoneCollectResp addCollect(@WebParam(name = "zoneCode") @QueryParam(value = "zoneCode") String zoneCode,
                                  @WebParam(name = "userID") @QueryParam(value = "userID") String userID,
                                  @WebParam(name = "programCode") @QueryParam(value = "programCode") String programCode,
                                  @WebParam(name = "programName") @QueryParam(value = "programName") String programName,
                                  @WebParam(name = "categoryCode") @QueryParam(value = "categoryCode") String categoryCode,
                                  @WebParam(name = "seriesFlag") @QueryParam(value = "seriesFlag") int seriesFlag,
                                  @WebParam(name = "seriesCode") @QueryParam(value = "seriesCode") String seriesCode,
                                  @WebParam(name = "poster") @QueryParam(value = "poster") String poster);

    @GET
    @Path(value = "removeCollect")
    @Produces(value = MediaType.APPLICATION_JSON)
    @WebMethod(action = "doRemoveCollect", operationName = "removeCollect")
    RemoveZoneCollectResp removeCollect(@WebParam(name = "zoneCode") @QueryParam(value = "zoneCode") String zoneCode,
                                        @WebParam(name = "userID") @QueryParam(value = "userID") String userID,
                                        @WebParam(name = "programCode") @QueryParam(value = "programCode") String programCode);

    @GET
    @Path(value = "getCollect")
    @Produces(value = MediaType.APPLICATION_JSON)
    @WebMethod(action = "doGetCollect", operationName = "getCollect")
    GetZoneCollectResp getCollect(@WebParam(name = "zoneCode") @QueryParam(value = "zoneCode") String zoneCode,
                                  @WebParam(name = "userID") @QueryParam(value = "userID") String userID,
                                  @WebParam(name = "programCode") @QueryParam(value = "programCode") String programCode);

    @GET
    @Path(value = "getCollectList")
    @Produces(value = MediaType.APPLICATION_JSON)
    @WebMethod(action = "doGetCollectList", operationName = "getCollectList")
    GetZoneCollectListResp getCollectList(@WebParam(name = "zoneCode") @QueryParam(value = "zoneCode") String zoneCode,
                                          @WebParam(name = "userID") @QueryParam(value = "userID") String userID,
                                          @WebParam(name = "firstIndex") @QueryParam(value = "firstIndex") int firstIndex,
                                          @WebParam(name = "maxResult") @QueryParam(value = "maxResult") int maxResult);

    @GET
    @Path(value = "emptyCollect")
    @Produces(value = MediaType.APPLICATION_JSON)
    @WebMethod(action = "doEmptyCollect", operationName = "emptyCollect")
    RemoveZoneCollectResp emptyCollect(@WebParam(name = "zoneCode") @QueryParam(value = "zoneCode") String zoneCode,
                                          @WebParam(name = "userID") @QueryParam(value = "userID") String userID);
	
	/*@POST
	@Path(value="addPlayRecord")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doAddPlayRecord",operationName="addPlayRecord")
	AddZonePlayRecordResp addPlayRecord(AddPlayRecordReq addPlayRecordReq);*/

    @GET
    @Path(value = "addPlayRecord")
    @Produces(value = MediaType.APPLICATION_JSON)
    @WebMethod(action = "doAddPlayRecord", operationName = "addPlayRecord")
    AddZonePlayRecordResp addPlayRecord(@WebParam(name = "zoneCode") @QueryParam(value = "zoneCode") String zoneCode,
                                        @WebParam(name = "userID") @QueryParam(value = "userID") String userID,
                                        @WebParam(name = "programCode") @QueryParam(value = "programCode") String programCode,
                                        @WebParam(name = "programName") @QueryParam(value = "programName") String programName,
                                        @WebParam(name = "categoryCode") @QueryParam(value = "categoryCode") String categoryCode,
                                        @WebParam(name = "playTime") @QueryParam(value = "playTime") int playTime,
                                        @WebParam(name = "seriesFlag") @QueryParam(value = "seriesFlag") int seriesFlag,
                                        @WebParam(name = "setNo") @QueryParam(value = "setNo") int setNo,
                                        @WebParam(name = "seriesCode") @QueryParam(value = "seriesCode") String seriesCode,
                                        @WebParam(name = "poster") @QueryParam(value = "poster") String poster,
                                        @WebParam(name = "totalPlayTime") @QueryParam(value = "totalPlayTime") int totalPlayTime);

    @GET
    @Path(value = "removePlayRecord")
    @Produces(value = MediaType.APPLICATION_JSON)
    @WebMethod(action = "doRemovePlayRecord", operationName = "removePlayRecord")
    RemoveZonePlayRecordResp removePlayRecord(@WebParam(name = "zoneCode") @QueryParam(value = "zoneCode") String zoneCode,
                                              @WebParam(name = "userID") @QueryParam(value = "userID") String userID,
                                              @WebParam(name = "programCode") @QueryParam(value = "programCode") String programCode);


    @GET
    @Path(value = "emptyPlayRecord")
    @Produces(value = MediaType.APPLICATION_JSON)
    @WebMethod(action = "doEmptyPlayRecord", operationName = "emptyPlayRecord")
    RemoveZonePlayRecordResp emptyPlayRecord(@WebParam(name = "zoneCode") @QueryParam(value = "zoneCode") String zoneCode,
                                              @WebParam(name = "userID") @QueryParam(value = "userID") String userID);

    @GET
    @Path(value = "getPlayRecord")
    @Produces(value = MediaType.APPLICATION_JSON)
    @WebMethod(action = "doGetPlayRecord", operationName = "getPlayRecord")
    GetZonePlayRecordResp getPlayRecord(@WebParam(name = "zoneCode") @QueryParam(value = "zoneCode") String zoneCode,
                                        @WebParam(name = "userID") @QueryParam(value = "userID") String userID,
                                        @WebParam(name = "programCode") @QueryParam(value = "programCode") String programCode);

    @GET
    @Path(value = "getPlayRecordList")
    @Produces(value = MediaType.APPLICATION_JSON)
    @WebMethod(action = "doGetPlayRecordList", operationName = "getPlayRecordList")
    GetZonePlayRecordListResp getPlayRecordList(@WebParam(name = "zoneCode") @QueryParam(value = "zoneCode") String zoneCode,
                                                @WebParam(name = "userID") @QueryParam(value = "userID") String userID,
                                                @WebParam(name = "firstIndex") @QueryParam(value = "firstIndex") int firstIndex,
                                                @WebParam(name = "maxResult") @QueryParam(value = "maxResult") int maxResult);


}

